from django.db import models
from django.db import connection
import time
# Create your models here.

class Item(models.Model):
    SUBMITPOOL_ID = models.AutoField(primary_key=True)
    SERIAL_NR = models.CharField(max_length = 30)
    PART_NR = models.CharField(max_length=25, null=True, default='')
    STATUS = models.CharField(max_length=15, null=True, default='KEYIN')
    RESULT = models.CharField(max_length=15, null=True, default='')

class Tran(models.Model):
	SUBMITPOOL_TRAN_ID = models.AutoField(primary_key=True)
	SUBMITPOOL = models.ForeignKey(Item )
	FromStatus = models.CharField(max_length=15, null=True, default='KEYIN')
	ToStatus = models.CharField(max_length=15, null=True, default='KEYIN')
	RESULT =  models.CharField(max_length=15, null=True, default='')
	TRAN_DATE = models.DateTimeField(auto_now_add=True)
